<?php
class BaiduShareWidget extends CWidget{
	private $outString;
	private $controller;
	private $action;
	

	public function init(){
		$this->controller = Yii::app()->controller->id;  
        $this->action = Yii::app()->controller->action->id; 
	}

	public function run(){
		$this->tuijian();
		echo $this->outString;
	}

	public function tuijian(){
		$this->outString = <<<BAIDUSHARE
			<script type="text/javascript" id="bdshare_js" data="type=slide&amp;img=5&amp;pos=right&amp;uid=2583784" ></script>
			<script type="text/javascript" id="bdshell_js"></script>
			<script type="text/javascript">
			var bds_config={"bdTop":120};
			document.getElementById("bdshell_js").src = "http://bdimg.share.baidu.com/static/js/shell_v2.js?cdnversion=" + Math.ceil(new Date()/3600000);
			</script>
BAIDUSHARE;




	
	}


}
?>

